package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author maxingjian
 * @since 2019-10-21
 */
@TableName("tt_operate_log")
public class OperateLogPO extends DMSBasePO<OperateLogPO> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "LOG_ID", type = IdType.AUTO)
    private Long logId;
    /**
     * 经销商公司id
     */
    @TableField("COMPANY_ID")
    private Long companyId;

    @TableField("APP_ID")
    private String appId;

    /**
     * 登录公司
     */
    @TableField("OWNER_CODE")
    private String ownerCode;
    /**
     *  职位
     */
    @TableField("USER_ORG_ID")
    private Long userOrgId;
    /**
     * 操作时间
     */
    @TableField("OPERATE_DATE")
    private LocalDateTime operateDate;
    /**
     * 操作内容
     */
    @TableField("OPERATE_CONTENT")
    private String operateContent;
    /**
     * 系统管理，业务接待，车间管理，结算管理，配件管理，客户管理，整车管理，导出（1009）
     */
    @TableField("OPERATE_TYPE")
    private Integer operateType;
    /**
     * 操作员
     */
    @TableField("OPERATOR")
    private Long operator;
    /**
     * 备注
     */
    @TableField("REMARK")
    private String remark;
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    public OperateLogPO() {
        super();
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public Long getLogId() {
        return logId;
    }

    public void setLogId(Long logId) {
        this.logId = logId;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public Long getUserOrgId() {
        return userOrgId;
    }

    public void setUserOrgId(Long userOrgId) {
        this.userOrgId = userOrgId;
    }

    public LocalDateTime getOperateDate() {
        return operateDate;
    }

    public void setOperateDate(LocalDateTime operateDate) {
        this.operateDate = operateDate;
    }

    public String getOperateContent() {
        return operateContent;
    }

    public void setOperateContent(String operateContent) {
        this.operateContent = operateContent;
    }

    public Integer getOperateType() {
        return operateType;
    }

    public void setOperateType(Integer operateType) {
        this.operateType = operateType;
    }

    public Long getOperator() {
        return operator;
    }

    public void setOperator(Long operator) {
        this.operator = operator;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.logId;
    }

    @Override
    public String toString() {
        return "OperateLogPO{" +
                "logId=" + logId +
                ", companyId=" + companyId +
                ", appId='" + appId + '\'' +
                ", ownerCode='" + ownerCode + '\'' +
                ", userOrgId=" + userOrgId +
                ", operateDate=" + operateDate +
                ", operateContent='" + operateContent + '\'' +
                ", operateType=" + operateType +
                ", operator=" + operator +
                ", remark='" + remark + '\'' +
                ", isDeleted=" + isDeleted +
                '}';
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author maxingjian
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "logId");
    }


}
